package cn.s1995.sloth.app.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

import cn.s1995.sloth.bizs.service.ImAccountService;
import cn.s1995.sloth.common.core.util.R;
import cn.s1995.sloth.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

/**
 * IM账户关系
 *
 * @author sloth
 * @date 2024-01-09 14:13:30
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/m/im/")
@Tag(description = "ImAccountController", name = "IM账户")
public class ApiIMAccountController {

    private final ImAccountService imAccountService;

    /**
     * 获取IM账号
     * @return
     */
	@ApiOperationSupport(order = 1)
    @Operation(summary = "获取IM账号", description = "获取IM账号")
    @GetMapping("/account")
    public R<String> getImAccount() {
        return R.ok(imAccountService.getImAccount(SecurityUtils.getUser()));
    }

}
